package net.myjung.account.impl;

import java.util.List;
import java.util.Map;

import net.myjung.account.AccAccount;
import net.myjung.account.AccException;
import net.myjung.account.IAccDao;
import net.myjung.dao.AbstractDaoHibernate;
import net.myjung.model.Conds;

public class AccDao extends AbstractDaoHibernate implements IAccDao {

	// Account scope begin
	public AccAccount getAccount(String id, Map<String,Object> options) throws AccException {
		try {
			return (AccAccount) get(AccAccount.class, id, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
	}
	public AccAccount setAccount(String user, AccAccount obj, Map<String,Object> options) throws AccException {
		try {
			set(user, obj, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
		return obj;
	}
	public AccAccount createAccount(String user, AccAccount obj, Map<String,Object> options) throws AccException {
		try {
			create(user, obj, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
		return obj;
	}
	public AccAccount updateAccount(String user, AccAccount obj, Map<String,Object> options) throws AccException {
		try {
			update(user, obj, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
		return obj;
	}
	public AccAccount deleteAccount(String id, Map<String,Object> options) throws AccException {
		try {
			return (AccAccount) delete(AccAccount.class, id, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
	}
	public List<AccAccount> getAccountList(Conds conds, Map<String,Object> options) throws AccException {
		try {
			return getList(AccAccount.class, conds, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
	}
	public long getAccountSize(Conds conds, Map<String,Object> options) throws AccException {
		try {
			return getSize(AccAccount.class, conds, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
	}
	public void deleteAccountList(Conds conds, Map<String,Object> options) throws AccException {
		try {
			deleteList(AccAccount.class, conds, options);
		} catch (Exception e) {
			throw new AccException(e);
		}
	}
	// Account scope end

}